using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Pervote.Core.Logic;

/// <summary>
/// Summary description for RegularMasterBase
/// </summary>
public abstract class RegularMasterBase : System.Web.UI.MasterPage
{
    private DataTable topCategories;
    public DataTable TopCategories
    {
        get { return topCategories; }
        set { topCategories = value; }
    }

    public RegularMasterBase()
    {
        this.Load += new EventHandler(Page_Load);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        LoadTopCategories();
    }

    private void LoadTopCategories()
    {
        long parentCategoryId = 1;
        string strCatId = Request.QueryString["ParentCategoryId"];
        if (strCatId != "" && strCatId != null) parentCategoryId = long.Parse(strCatId);
        CategoryManager catMan = new CategoryManager();
        topCategories = catMan.GetAllCategories();
    }
}
